function  check_info(w_type,id,check_span_id,td_check_id,length,type)
{
	value = ($('#'+check_span_id).html());
	value = value.replace(/"/g,'&quot;');
	$("#"+check_span_id).remove();
	$("#"+td_check_id).html('<input type="text" id="'+check_span_id+'"  value="'+value+'"   style="width:'+length+'px" />');
	$("#"+check_span_id).focus();
	$("#"+check_span_id).blur( function () 
	{ 	  
		var check_value = $('#'+check_span_id).val();		
		
		if(type == 'p_page_click' || type == 'sort'  || type=='ar_count')
		{
		check_value = parseInt(check_value);
		}	
		var str ="<span   id='"+check_span_id+"' >"+check_value+"</span>";
		
		$("#"+td_check_id).html("");
		$("#"+td_check_id).html(str);
		
		$("#"+check_span_id).mouseout( function () { check_css(check_span_id,0); }); 
		$("#"+check_span_id).mouseover( function () { check_css(check_span_id,1); }); 
		
		$("#"+check_span_id).click( function () { check_info(w_type,id,check_span_id,td_check_id,length,type); }); 
		
		if(type == 'position_name')
		{
			$.get("/wondershare/ad_position.php?action=update_value", { type:type, position_id: id,value:check_value },
			function(data){});  
		}
		
	});


}

function  check_css(element_id,type)
{
	if(type==1)
	{
		$("#"+element_id).css({  "background": "blue","color": "#ff0011"}); 
	}
	else
	{
		$("#"+element_id).css({ "background": "","color":""}); 
	}

}

function  delete_faq_comment(id,type,act_type)
{
	var str = "";
	var falge = false;
	if(type == 'list')//代表为多选
	{
		if(!confirm('您确定要删除选中的FAQ评论记录吗？'))
		{
			$('input[name="ID[]"]').each(function () {
				$(this).attr('checked',false)
			});
			return false;
		}
		$('input[name="ID[]"]').each(function () {
			if ($(this).attr('checked')) 
			{
				falge = true;
				str += $(this).val() + ",";
				$("#tr_"+$(this).val()).remove();
				$('#total').html(parseInt($('#total').html())-1) ;
			}
		});
		if(!falge)
		{
			alert('你没有选择任何选项！');   
		}
	
	}else
	{
		str = id+','; 
		$("#tr_"+id).remove();
		$('#total').html(parseInt($('#total').html())-1) ;
	}
	if(act_type == 'faq_comment')//代表为广告删除
	{
		$.get("/wondershare/faq_comment.php?action=del", {checkList: str },
		function(data){}); 
	}

}


function getfaqlist(type)
{
	var co_new_id = $("#co_new_id").val();
	var co_type= $("#co_type").val();
	if(type == 'get_faq_info')
	{
		jIframe('', '显示所有FAQ列表', {
		width: 750,
		height: 345,
		src: './faq_comment.php?action=faq_list&co_new_id='+co_new_id+'&co_type='+co_type,
		ID: 'all_faq_list',
		box_btn:true,
		callback:add_faq
		});
	}

}

function add_faq()
{
	var faq_id = document.getElementById("all_faq_list").contentWindow.get_checked_faq_id();
	var faq_name = document.getElementById("all_faq_list").contentWindow.get_checked_faq_name();
	var faq_type = document.getElementById("all_faq_list").contentWindow.get_checked_faq_type();
	set_rating_show(faq_type);
	$("#co_type").val(faq_type);
	$("#co_new_name").val(faq_name);
	$("#article_name").val(faq_name);
	$("#co_new_id").val(faq_id);
	jClose();
}

//显示 如果评论是 视频 则 显示 下拉 星级下啦 否则显示是否有用
function  set_rating_show(cp_type)
{
	if(cp_type == 2)//显示视频tr
	{
		$("#tr_co_rating").show();
		$("#tr_co_useful").hide();
	}else if(cp_type == 1 || cp_type == 3)
	{
		$("#tr_co_rating").hide();
		$("#tr_co_useful").show();
	}else
	{
		$("#tr_co_rating").hide();
		$("#tr_co_useful").hide();  
	}
}


